package com.kamistoat.ruoyiapisystem.controller;

import java.util.Arrays;
import java.util.Map;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.kamistoat.ruoyiapisystem.entity.SysLogininforEntity;
import com.kamistoat.ruoyiapisystem.service.SysLogininforService;
import com.kamistoat.common.utils.PageUtils;
import com.kamistoat.common.utils.R;



/**
 * 系统访问记录
 *
 * @author kamistoat
 * @email linjianshanke@163.com
 * @date 2022-08-09 10:34:46
 */
@RestController
@RequestMapping("ruoyiapisystem/syslogininfor")
public class SysLogininforController {
    @Autowired
    private SysLogininforService sysLogininforService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    // @RequiresPermissions("ruoyiapisystem:syslogininfor:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = sysLogininforService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{infoId}")
    // @RequiresPermissions("ruoyiapisystem:syslogininfor:info")
    public R info(@PathVariable("infoId") Long infoId){
		SysLogininforEntity sysLogininfor = sysLogininforService.getById(infoId);

        return R.ok().put("sysLogininfor", sysLogininfor);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    // @RequiresPermissions("ruoyiapisystem:syslogininfor:save")
    public R save(@RequestBody SysLogininforEntity sysLogininfor){
		sysLogininforService.save(sysLogininfor);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    // @RequiresPermissions("ruoyiapisystem:syslogininfor:update")
    public R update(@RequestBody SysLogininforEntity sysLogininfor){
		sysLogininforService.updateById(sysLogininfor);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    // @RequiresPermissions("ruoyiapisystem:syslogininfor:delete")
    public R delete(@RequestBody Long[] infoIds){
		sysLogininforService.removeByIds(Arrays.asList(infoIds));

        return R.ok();
    }

}
